home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / tlx_sq21.zip / TAGLINE.SLT < prev    next >
Text File  |  1992-01-15  |  2KB  |  83 lines

  1. //-----------------------------------------------------------
  2. // TAGLINE.SLT Send tagline.
  3. //
  4. // Please look at the comments through the whole file, and modify to
  5. // suit your needs, BEFORE you use it. Then recompile with CS TAGLINE.
  6. //-----------------------------------------------------------
  7.  
  8. // If you have suggestions for improving this script, please suggest
  9. // improvements to me via old-fashioned snail-mail to:
  10.  
  11. // Author:  Inge Vabekk
  12. //          Hamangskogen 108
  13. //          N-1300 SANDVIKA
  14. //          NORWAY
  15. //          tel. (472) 546 396
  16.  
  17. str bbs_type[32]         // BBS type.
  18.    ,tagline [80]         // Tagline.
  19.    ,help    [80]         // Help line.
  20.    ,bbstype []="BTYPE"   // BBS type.
  21.    ,version []="BBSver"  // PCB version.
  22.    ,tag    [4]           // Tagline.
  23.    ,global  []="GLOBAL"  // Name of Global script.
  24.    ;
  25.  
  26. //-----------------------------------------------------------   
  27. // Script starts here.
  28. //-----------------------------------------------------------   
  29.  
  30. main()
  31. {
  32. int BBSver;
  33.  
  34.   BBSver = 0;
  35.   call (global,"R",bbstype,tagline);     // Get BBS type.
  36.   if (tagline == "PCB" )
  37.   { call (global,"R",version,tagline);   // PCBoard:
  38.     BBSver = subchr (tagline,0);         // Get version.
  39.   }
  40.  
  41.   if (call (global,"R","TAGA",tagline) > 0) // Get tagline a.
  42.   { if (BBSver > 144) prints (tagline);
  43.     wline (tagline);
  44.   }
  45.  
  46.   call (global,"R","TAGX",help);         // Get tagline X.
  47.   if (strlen(help) > 0) strcat (help," ");
  48.  
  49. // Different tagline for PCB and other systems.
  50.  
  51.   if (BBSver)                            // PCB:
  52.     tag = "TAGC";                        // Tagline C.
  53.   else
  54.     tag = "TAGB";                        // No, tagline B.
  55.   
  56.   call (global,"R",tag,tagline);         // Get tagline b or c.
  57.   strcat (help,tagline);                 // Add to previous.
  58.   if (strposi (help,"!END",0) >=0) return; // Cut here?
  59.  
  60.   if (BBSver > 144) prints (help);
  61.   wline (help);
  62. }
  63.  
  64. //-----------------------------------------------------------   
  65. // Write line to COMx.
  66. //-----------------------------------------------------------   
  67.  
  68. wline(str line)
  69. {
  70. int l;
  71.   
  72.   for (l=strlen(line)-1; l>=0; --l)      // Strip trailing spaces.
  73.   { if (subchr(line,l) > ' ') break;
  74.     setchr (line,l,0);
  75.   }
  76.   while ((l=strchr(line,0,255)) >=0)     // Find 'FF' in line. 
  77.     setchr(line,l,' ');                  // Replace with normal spaces. 
  78.  
  79.   cputs (line);
  80.   cputs ("^M");
  81. }
  82.  
  83.